home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group03a.txt
/
000066_icon-group-sender_Fri Mar 28 16:48:55 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2003-12-22
|
5KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2SNmjI02806
for icon-group-addresses; Fri, 28 Mar 2003 16:48:45 -0700 (MST)
Message-Id: <200303282348.h2SNmjI02806@baskerville.CS.Arizona.EDU>
From: voice_of_reason@australia.edu (Quiet Voice)
X-Newsgroups: comp.lang.icon
Subject: Re: Befuddled by logic and an error message.....
Date: 28 Mar 2003 11:31:13 -0800
X-Complaints-To: groups-abuse@google.com
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Once again following up my own follow-up....
Thank you to all for the email responses.
As it turns out, I have solved my problem...at least this one.
I'm still not certain what was causing the error, but I suspected it
revolved around reading from and writing to the same file. So I
developed a work-around by creating *TWO* temp files to hold the
editing: one for reading from and one for writing two. For each pass
thru the editing loop, the program swaps which is the read and which
is the write file. So the editing updates that you write to one file
are then read out during the next pass and written to the other file
(along with the newest updates). Back and forth...etc etc.
Its a bit of a kludge.....but it works!
Again, thanks!
voice_of_reason@australia.edu (Quiet Voice) wrote in message news:<9428c6a7.0303280746.51de65da@posting.google.com>...
> A follow-up to my own post based on some e:mail I recieved....
>
> >Are you running on Windows or UNIX...on NT4SP6a with
> >Icon 9.3.2 I get this:
> >
> >Run-time error 214
> >File io.icn; Line 4
> >input/output error
> >offending value: 68
> >Traceback:
> > main()
> > write(file(x),68) from line 4 in io.icn
> >
>
> I am running under Win 2000 with version 9.3.2.....and that is
> precisely the error message I get.
>
> >
> >But I've got a broader question: Why is the temp file necessary?
>
> I use the temp file because the editting process is iterative.
>
> What I mean is that the program reads in the original file, writes it
> over to a temporary holding file and offers the user a chance to edit
> the file, observe the results and re-edit...over and over...until he
> is satisfied. Each time, the program outputs the original file along
> side the most recent edits.
>
> Once satisfied, the program writes out the final version of the temp
> file as the "answer".
>
>
>
> voice_of_reason@australia.edu (Quiet Voice) wrote in message news:<9428c6a7.0303271418.6dd64a38@posting.google.com>...
> > Greetings:
> >
> > Still in my endeavor to "re-learn" ICON, I have hit upon a bug that is
> > partially a logic bug and partially a runtime error.
> >
> > What I am attempting to do is as follows --
> >
> > A file is opened which contains text.
> >
> > The idea of the program is to allow the user to selectively and
> > iteratively edit and re-edit the file and see the edits alongside the
> > original version of text.
> >
> > The program creates and output file that holds the original text and
> > the current state of editing.
> >
> > A line from the original file along with the corresponding edited line
> > are written to output.
> >
> > With each pass thru the loop the idea is that the program opens a temp
> > file that holds the current editing. The user is essentially
> > iteratively editing the temp file.
> >
> > Here's the code fragment along with comments I've written to
> > myself....
> >
> > target := current text
> > edit := proposed edits
> > .
> > .
> > .
> >
> > # LOGIC PROBLEM WITH THIS LOOP. NEED TO READ DATA FROM CURRENT GUESS
> > *THEN* SAVE NEW GUESS FOR
> > # FUTURE READ....but NEED TO PREVENT "INFINTIE LOOP" SITUATION OF
> > READING THEN WRITING THEN READING>>>>ETC
> >
> > # CURRENT VERSION RESULTS IN RUN-TIME ERROR: 214 (???) in line 88
> >
> > while (line := read(temp_holder)) do
> > {
> > orig := read(orig_text)
> > trial_line := map(line,target,edit)
> >
> > write(output,"original: ",orig)
> > write(output," ")
> > write(output,"new: ",trial_line)
> > write(output," ")
> >
> > OFFENDING LINE OF CODE ==> write(temp_holder,trial_line) # save
> > current trial set
> > }
> >
> > write("TRIAL CORRECTIONS WRITTEN TO TEMPORARY FILE.")
> > writes("Do you have more corrections? Type yes or no: ")
> > more := read()
> >
> > } #end INPUT loop
> >
> >
> > ---
> > First of all, what sort of situations create a runtime error 214? What
> > am I doing wrong?
> >
> > Secondly, any suggestions on how better to accomplish this?
> >
> > Thanks for the advice and assitance.....